package com.yxhl.zoume.core.tripsmgmt.info;

/**
 * Created by yxhl on 15/11/21.
 */
public enum PassengerType {

    ADULT(1, "成人"), CHILD(2, "儿童"), SOLDIER(3, "军人");

    private int type;
    private String name;

    PassengerType(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public static PassengerType getPassengerTypeByValue(int type) {
        for (PassengerType passengerType : PassengerType.values()) {
            if (passengerType.getType() == type) {
                return passengerType;
            }
        }
        return CHILD;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

}
